using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace DataAccessLayer
{
    [Serializable, XmlType("Menu")]
    public sealed class GameMenu
    {
        [XmlAttribute]
        public int ID { get; set; }

        [XmlElement]
        public string Title { get; set; }

        [XmlElement]
        public string BackgroundImage { get; set; }

        [XmlElement]
        public string BackgroundSound { get; set; }

        [XmlElement]
        public XmlFont SpriteFont { get; set; }

        [XmlElement]
        public string Color { get; set; }

        [XmlArray("Menu Options"), XmlArrayItem("Option")]
        public List<MenuOption> MenuOptions { get; set; }

        public GameMenu()
        {
            Title = "New Menu";
            BackgroundImage = "";
            BackgroundSound = "";
            Color = "White";
            SpriteFont = new XmlFont();
            MenuOptions = new List<MenuOption> { new MenuOption() };
        }

        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String" /> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            return Title;
        }
    }
}